<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page import="com.ce.sys.login.model.*" %>
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib uri="/struts-tags" prefix="s" %>
<%@ include file="/common/common.jsp"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<script type="text/javascript">
var portal;
var panels;

$(function() {
	
	panels = [ {
		id : 'p1',
		title : '各稽查局案件处理情况',
		height : 300,
		collapsible : true,
		content:'<iframe id="desktop" src="<%=path %>/cases/source/CaseSourceReceive_caseSourceReceiveColumn2.action" scrolling="auto" frameborder="0" style="width:100%;height:100%;"></iframe>'
		
	}, {
		id : 'p2',
		title : '案件进展情况统计',
		height : 300,
		collapsible : true,
		content:'<iframe id="desktop" src="<%=path %>/cases/source/CaseSourceReceive_caseSourceReceiveColumn.action" scrolling="auto" frameborder="0" style="width:100%;height:100%;"></iframe>'
	}, {
		id : 'p3',
		title : '待办事项',
		height : 300,
		collapsible : true,
		content:'<iframe id="desktop" src="<%=path %>/cases/source/CaseSourceReceive_getCaseSourceDb.action" scrolling="auto" frameborder="0" style="width:100%;height:100%;"></iframe>'
	}, {
		id : 'p4',
		title : '个人待解决问题统计',
		height : 300,
		collapsible : true,
		content:'<iframe id="desktop" src="<%=path %>/cases/source/CaseSourceReceive_caseSourceReceiveColumn3.action" scrolling="auto" frameborder="0" style="width:100%;height:100%;"></iframe>'
	}];

	portal = $('#portal').portal({
		border : false,
		fit : true,
		onStateChange : function() {
			$.cookie('portal-state', getPortalState(), {
				expires : 7
			});
		}
	});
	
	var state = $.cookie('portal-state');
	if (!state) {
		state = 'p1,p3:p2,p4';/*冒号代表列，逗号代表行*/
	}
	addPanels(state);
	portal.portal('resize');
});

function getPanelOptions(id) {
	for ( var i = 0; i < panels.length; i++) {
		if (panels[i].id == id) {
			return panels[i];
		}
	}
	return undefined;
}

function getPortalState() {
	var aa=[];
	for(var columnIndex=0;columnIndex<2;columnIndex++) {
		var cc=[];
		var panels=portal.portal('getPanels',columnIndex);
		for(var i=0;i<panels.length;i++) {
			cc.push(panels[i].attr('id'));
		}
		aa.push(cc.join(','));
	}
	return aa.join(':');
}
function addPanels(portalState) {
	var columns = portalState.split(':');
	for (var columnIndex = 0; columnIndex < columns.length; columnIndex++) {
		var cc = columns[columnIndex].split(',');
		for (var j = 0; j < cc.length; j++) {
			var options = getPanelOptions(cc[j]);
			if (options) {
				var p = $('<div/>').attr('id', options.id).appendTo('body');
				p.panel(options);
				portal.portal('add', {
					panel : p,
					columnIndex : columnIndex
				});
			}
		}
	}
}

<!--
  // $(function(){
  // $('#p1').panel();
  // $('#p2').panel();
  // $('#p3').panel();
 //  $('#p4').panel();
 //  });
//-->
</script>

<div id="portal" style="position:relative;height:100%">
	<div></div>
	<div></div>
</div>
